<!-- BEGIN: PAGECONTENT -->
        <script type="text/javascript">
			$(document).ready(function() {
			    //validate signup form on keyup and submit
			    $("#admin_form").validate({
			        rules: {
			            Title: {
			                required: true,
			                maxlength: 70
			            }
			        },
			        messages: {
			            Title: {
			                required: "Tiêu đề không được phép để chống",
			                maxlength: "Tiêu đề không nên dài quá 70 ký tự"
			            }
			        }
			    });
			    
			    // Initialise FancyBox Modal window:
			    $("a.fancy").fancybox({
			        'titlePosition' : 'inside'
			    });
			    
			 	// set file type
			    setFileType();
			    
			    $('#ImageLink').change(function() {
			    	setFileType();
		    	});
			});
		</script>
		<style type="text/css">
		    #admin_form label.error { width: 100%; color:red; margin-top:5px;}
		</style>
        <script type="text/javascript">
            function BrowseServer()
            {
                var finder = new CKFinder();
                finder.basePath = 'images/';
                finder.selectActionFunction = SetFileField;
                finder.popup();
            }
            
         	// This is a sample function which is called when a file is selected in CKFinder.
            function SetFileField( fileUrl )
            {
            	$("#ImageLink").val(fileUrl);
            	setFileType();
            }
			
            function setFileType(){
            	var imageLink = $("#ImageLink").val();
            	
            	if (imageLink.length > 0){
            			$('div#over-view').html("<a href=\""+imageLink +"\" class=\"fancy\" rel=\"group\" id=\"upload-img-fancy\"><img src=\""+imageLink +"\" id=\"upload-img\" style=\"max-height: 250px;\"></a>");
            			// Initialise FancyBox Modal window:
        			    $("a.fancy").fancybox({
        			        'titlePosition' : 'inside'
        			    });
            	} else {
                	$('div#over-view').html("");
            	}
            }
        </script>
        <div class="form-content-page">
            <section>
			        <form class="block-content form" id="admin_form" method="post" action="submit.php?ctrl={CONTROLLER}&act={ACTION}">
			            <h2>{FORMTITLE}</h2>
			            <!-- BEGIN: ITEM -->
			            <fieldset>
			                <legend>
			                    Nội dung danh mục
			                </legend>
			                <input type="hidden" name="ID" id="ID" value="{ITEM.ID}">
			                <input type="hidden" name="CategoryID" id="CategoryID" value="{ITEM.CategoryID}">
			                <div class="columns">
                                <div class="colx2-left">
                                 	<p>
					                    <label for="Title">Tiêu đề:</label>
					                    <input type="text" name="Title" id="Title" value="{ITEM.Title}" class="full-width">
					                </p>
					                <p>
					                    <label for="Description">Miêu tả: </label>
					                    <textarea name="Description" id="Description" class="full-width height-150">{ITEM.Description}</textarea>
					                </p>
                                </div>
                                <div class="colx2-right">
                                	<div class="imageBox">
		                                <label for="ImageLink">Ảnh đại diện:</label>
		                                <div style="width: 100%" align="center" id="over-view">
			                               <a href="{ITEM.ImageLink}" class="fancy" rel="group" id="fancyLogoLink"><img src="{ITEM.ImageLink}" style="max-height: 250px;"></a>
			                            </div>
			                            <br /> 
		                                <input type="text" name="ImageLink" id="ImageLink" value="{ITEM.ImageLink}" class="half-width">
		                                &nbsp;&nbsp; <button type="button" class="grey browser-file" onclick="BrowseServer();">Chọn ảnh</button>
		                            </div>
                                </div>
                            </div>
			            </fieldset>
			            <fieldset>
			                <legend>
			                    Nội dung SEO
			                </legend>
			                <div class="columns">
                                <div class="colx2-left">
                                	<p>
					                    <label for="TitleTag">Thẻ Title:</label>
					                    <input type="text" name="TitleTag" id="TitleTag" value="{ITEM.TitleTag}" class="full-width">
					                </p>
					                <p>
					                    <label for="URL">Đường dẫn URL: (chỉ chứa các chữ cái không dấu và dấu gách ngang "-")</label>
					                    <input type="text" name="URL" id="URL" value="{ITEM.URL}" class="full-width">
					                </p>
					                <p>
					                    <label for="MetaKeyword">Meta Keyword: (các từ khóa ngăn cách nhau bằng dấu phẩy ",")</label>
					                    <input type="text" name="MetaKeyword" id="MetaKeyword" value="{ITEM.MetaKeyword}" class="full-width">
					                </p>
                                </div>
                                <div class="colx2-right">
                                    <p>
					                    <label for="MetaDescription">Meta Description:</label>
					                    <textarea name="MetaDescription" id="MetaDescription" class="full-width height-150">{ITEM.MetaDescription}</textarea>
					                </p>
                                </div>
                            </div>
			            </fieldset>
			            <fieldset class="grey-bg no-margin">
			                <p class="input-with-button" align="center">
			                    <button type="submit">
			                        Hoàn thành
			                    </button>
			                    <a href="maincontent.php?ctrl={CONTROLLER}&act=view-table&cid={ITEM.CategoryID}"> 
				                    <button type="button">
		                                Hủy bỏ
		                            </button> 
	                            </a>
			                </p>
			            </fieldset>
			            <!-- BEGIN: ITEM -->
			        </form>
			</section>
        </div>
<!-- END: PAGECONTENT -->